#ifndef _LEDFlash_H__
#define _LEDFlash_H__
class LEDFlash
{
private:
    unsigned long preFlashTime = 0ul;
    unsigned long delayTime = 1000ul;

public:
    LEDFlash()
    {
        pinMode(LED_BUILTIN, OUTPUT);
    }
    LEDFlash(unsigned long _delayTime) : LEDFlash()
    {
        delayTime = _delayTime;
    }
    ~LEDFlash()
    {
    }
    void loop()
    {
        unsigned long curTime = millis();
        if (curTime - preFlashTime > delayTime)
        {
            preFlashTime = curTime;
            static bool FLAG = true;
            digitalWrite(LED_BUILTIN, (FLAG = !FLAG) ? HIGH : LOW);
        }
    }
};
#endif